package com.mvc.demo;

import com.mvc.demo.service.UserService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author H
 * @date 2023/1/5
 */
@SpringBootApplication
public class SpringMvcApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(SpringMvcApplication.class, args);
        UserService bean = applicationContext.getBean(UserService.class);
        bean.test();
    }

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
